package scuba.DiveBuddy.Fragments.LogViewer;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import scuba.DiveBuddy.Class.LogEntries;
import scuba.DiveBuddy.Class.LogEntry;
import scuba.DiveBuddy.Core.Toolbelt;
import scuba.DiveBuddy.Core.Tuple;
import scuba.DiveBuddy.Enums.*;
import scuba.DiveBuddy.R;

/**
 * @author Alex Anderson
 * @version 1.0
 * @since {26/02/14}
 */
public class LogDataFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_viewer_data, container, false);

        LogEntry current = LogEntries.getCurrent();

        TextView t = (TextView)v.findViewById(R.id.spinWaterType);
        t.setText(current.getWaterType().toString());

        t = (TextView)v.findViewById(R.id.tempSurfaceSelect);
        t.setText(current.getSurfaceTemperature() + "");

        t = (TextView)v.findViewById(R.id.tempDepthSelect);
        t.setText(current.getDepthTemperature() + "");

        t = (TextView)v.findViewById(R.id.spinTempUnits);
        t.setText(current.getTemperatureUnits().toString());

        t = (TextView)v.findViewById(R.id.altitudeSelect);
        t.setText(current.getAltitude() + "");

        t = (TextView)v.findViewById(R.id.spinAltitudeUnits);
        t.setText(current.getAltitudeUnits().toString());

        t = (TextView)v.findViewById(R.id.weightSelect);
        t.setText(current.getWeight() + "");

        t = (TextView)v.findViewById(R.id.spinWeightUnits);
        t.setText(current.getWeightUnits() + "");

        t = (TextView)v.findViewById(R.id.visibilitySelect);
        t.setText(current.getVisibility() + "");

        t = (TextView)v.findViewById(R.id.spinVisUnits);
        t.setText(current.getVisibilityUnits() + "");

        t = (TextView)v.findViewById(R.id.exposureSelect);
        t.setText(current.getExposureProtectionMM() + "");

        t = (TextView)v.findViewById(R.id.spinExposureType);
        t.setText(current.getExposureSuit() + "");

        t = (TextView)v.findViewById(R.id.observations);
        t.setText(current.getObservations());

        return v;
    }
}
